﻿<!DOCTYPE html>
<!-- saved from url=(0048)http://aui.github.io/artTemplate/demo/basic.html -->
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8">
    <title>basic-demo</title>
    <script src="scripts/jquery-2.0.3.js"></script>
    <script src="scripts/arttemplate.js"></script>
    <style type="text/css"></style>
</head>

<body style="" cz-shortcut-listen="true">
    <div id="content">
    </div>
    <script id="test" type="text/html">
        <% if (isAdmin) { %>
        <h1><%=title%></h1>
        <ul>
            <% for (var i = 0; i < list.length; i ++) { %>
       
            <li>索引 <%= i + 1 %> ：<%= list[i] %></li>
            <% } %>
        </ul>

        <% } %>
    </script>

    <script type="text/javascript">
        var data = {
            title: '基本例子',
            isAdmin: true,
            list: ['文艺', '博客', '摄影', '电影', '民谣', '旅行', '吉他']
        };
        var html = template.render('test', data);
        document.getElementById('content').innerHTML = html;
</script>

</body>
</html>
